<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #canvas {
        border: 1px solid black;
      }
    </style>
  </head>
  <body>
    <canvas id="canvas" height="650" width="650"></canvas>

    <script>
      const canvas = document.getElementById("canvas");
      ctx = canvas.getContext("2d");
      ctx.beginPath();
      ctx.moveTo(100, 100);
      ctx.lineTo(100, 200);
      ctx.lineTo(200, 200);
      ctx.lineTo(200, 100);
      ctx.lineTo(100, 100);
      ctx.setLineDash([5, 20]);
      ctx.strokeStyle = "#00cc00";
      ctx.lineWidth = 10;
      ctx.closePath();
      ctx.stroke();
      ctx.beginPath();
      ctx.moveTo(300, 100);
      ctx.lineTo(300, 200);
      ctx.lineTo(400, 200);
      ctx.lineTo(400, 100);
      ctx.lineTo(300, 100);
      ctx.fillStyle = "#0000cc";
      ctx.closePath();
      ctx.fill();
    </script>
  </body>
</html>
